<?php

namespace module\manage\validate;

use app\Validate;

class Me extends Validate
{
    /**
     * 验证场景.
     *
     * @var array<array<string>>
     */
    protected $scene = [
        'update' => ['name', 'avatar'],  // 密码登录
        'reset' => ['origin', 'password', 'password_confirm'],  // 密码登录
    ];
    /**
     * 验证规则.
     *
     * @var array<string>
     */
    protected $rule = [
        'origin'  => 'requireWithout:id|min:6|max:16',  // 密码
        'password'  => 'requireWithout:id|min:6|max:16',  // 密码
        'password_confirm' => 'confirm:password',  // 确认密码
    ];
    /**
     * 验证字段描述
     * 
     * @var array<string>
     */
    protected $field = [
        'origin' => '原始密码',
        'password' => '新密码',
        'password_confirm' => '确认密码',
    ];
}